package com.jiwei.community.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jiwei.community.entity.SignInRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


/**
 * (SignInRecord)表数据库访问层
 *
 * @author jiwei
 * @since 2024-03-20 11:00:01
 */
public interface SignInRecordMapper extends BaseMapper<SignInRecord> {
    @Select("SELECT * FROM sign_in_record WHERE user_id = #{userId} AND community_id = #{communityId} ORDER BY create_at DESC LIMIT 1")
    SignInRecord getLatestSignInRecord(@Param("userId") Long userId,@Param("communityId") Long communityId);
}

